/**
 * 
 */
package de.damontools.awolowa.application;

import java.util.List;

import android.app.Application;
import android.content.Context;
import de.damontools.awolowa.db.DatabaseManager;

/**
 * @author damon
 *
 */
public class Profile extends Application{
	private int mID;
	private String mProfilName;
	private String mSSID;
	private String mMAC;
	private int mNrPackages;
	private boolean mGetGlobalOption;
	private boolean mActive;
    static DatabaseManager mDB;
    static List<Profile> mProfileList;

	public Profile(){
	}

	public Profile(int id, String profileName, String ssid, String mac, int nrPackages, String getGlobalOption, boolean active){
		setID(id);
		setProfilName(profileName);
		setSSID(ssid);
		setMAC(mac);
		setNrPackages(nrPackages);
		setGetGlobalOption(getGlobalOption);
		setActive(active);
	}
	public Profile(String profileName, String ssid, String mac, int nrPackages, String getGlobalOption, boolean active){
		setProfilName(profileName);
		setSSID(ssid);
		setMAC(mac);
		setNrPackages(nrPackages);
		setGetGlobalOption(getGlobalOption);
		setActive(active);
	}
	
	public static List<Profile> getList(Context context){
		mDB = new DatabaseManager(context);
		mProfileList = mDB.getAllProfiles();
		return mProfileList;	
	}
	/**
	 * @return the mProfilName
	 */
	public String getProfilName() {
		return mProfilName;
	}
	/**
	 * @param profileName the mProfilName to set
	 */
	public void setProfilName(String profileName) {
		this.mProfilName = profileName;
	}
	/**
	 * @return the mSSID
	 */
	public String getSSID() {
		return mSSID;
	}
	/**
	 * @param ssid the mSSID to set
	 */
	public void setSSID(String ssid) {
		this.mSSID = ssid;
	}
	/**
	 * @return the mMAC
	 */
	public String getMAC() {
		return mMAC;
	}
	/**
	 * @param mac the mMAC to set
	 */
	public void setMAC(String mac) {
		this.mMAC = mac;
	}
	/**
	 * @return the mNrPackages
	 */
	public int getNrPackages() {
		return mNrPackages;
	}
	/**
	 * @param nrPackages the mNrPackages to set
	 */
	public void setNrPackages(int nrPackages) {
		this.mNrPackages = nrPackages;
	}
	/**
	 * @return the mGetGlobalOption
	 */
	public boolean isGetGlobalOption() {
		return mGetGlobalOption;
	}
	/**
	 * @param getGlobalOption the mGetGlobalOption to set
	 */
	public void setGetGlobalOption(String getGlobalOption) {
		boolean tmp = Boolean.parseBoolean(getGlobalOption);
		this.mGetGlobalOption = tmp;
	}
	/**
	 * @return the mActive
	 */
	public boolean isActive() {
		return mActive;
	}
	/**
	 * @param active the mActive to set
	 */
	public void setActive(boolean active) {
//		boolean tmp = Boolean.parseBoolean(active);
		this.mActive = active;
	}
	/**
	 * @return the mID
	 */
	public int getID() {
		return mID;
	}
	/**
	 * @param mID the mID to set
	 */
	public void setID(int mID) {
		this.mID = mID;
	}

}
